
#include <machine/asm.h>
ENTRY(strchr)
	popl	%edx		/* Return address */
	popl	%eax		/* String pointer */
	popl	%ecx		/* Character to find */
	pushl	%ecx
	pushl	%eax
	pushl	%edx
1:
	cmpb	%cl, 0(%eax)
	je 3f
	cmpb	$0, 0(%eax)
	je 2f
	incl	%eax
	jmp 1b
2:
	xorl	%eax, %eax
3:
	ret
END(strchr)
